package com.wtp.wallpaper.config;

import com.wtp.wallpaper.common.properties.AliOssProperties;
import com.wtp.wallpaper.common.properties.XFXHProperties;
import com.wtp.wallpaper.utils.AliOssUtil;
import com.wtp.wallpaper.utils.ai.XFXHUtil;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.RedisTemplate;

@Configuration
@EnableConfigurationProperties(XFXHProperties.class)
public class XFXHConfig {
    @Bean
    @ConditionalOnMissingBean
    public XFXHUtil xfxhUtil(XFXHProperties xfxhProperties){
        return new XFXHUtil(
                xfxhProperties.getAppid(),
                xfxhProperties.getApiSecret(),
                xfxhProperties.getApiKey(),
                xfxhProperties.getImage_generate_url(),
                xfxhProperties.getImage_understand_url());
    }
}
